package com.yuanfuxing.boxuegu.activity;

import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.MediaController;
import android.widget.VideoView;

import com.yuanfuxing.boxuegu.R;

public class VideoActivity extends AppCompatActivity {
    VideoView videoView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video);

        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

        String videourl = getIntent().getStringExtra("video");
        videoView = (VideoView) findViewById(R.id.videoview);
        videoView.setVideoURI(Uri.parse(videourl));
        MediaController controller = new MediaController(this);
        videoView.setMediaController(controller);
        videoView.start();
    }
}
